﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using Foolproof;
using System.Web.Mvc;
using FreedBack.Core.Entities;

namespace FreedBack.Models
{
    public class FeedbackFormModel
    {
        [Key]
        public virtual int FeedbackFormId { get; set; }

        [Required(ErrorMessage = "Type of feedback must be supplied.")]
        [Display(Name = "Type of feedback")]
        public int? FeedbackTypeId { get; set; }

        [Required(ErrorMessage = "Area feedback relates to must be supplied.")]
        [Display(Name = "Area feedback relates to")]
        public int? AreaOfFeedbackId { get; set; }

        [RequiredIf("AreaOfFeedbackId", Operator.EqualTo, (int)IdentificationEnums.AreasOfFeedback.Other)]
        [MaxLength(200, ErrorMessage = "Describe the area feedback relates to must be no more than 200 characters in length")]
        [Display(Name = "Describe the area feedback relates to")]
        public string AreaOfFeedbackOther { get; set; }

        [Required(ErrorMessage = "How strongly you feel about this must be supplied.")]
        [Display(Name = "How strongly do you feel about this?")]
        public int? RatingValueId { get; set; }

        [Required(ErrorMessage="Comments must be supplied")]
        [MaxLength(1000, ErrorMessage = "Description must be no more than 1000 characters in length")]
        [Display(Name = "Comments")]
        public string Comments { get; set; }

        [HiddenInput(DisplayValue=false)]
        [MaxLength(2000, ErrorMessage = "Source URL must be no more than 2000 characters in length")]
        public string SourceUrl { get; set; }

        [HiddenInput(DisplayValue = false)]
        [MaxLength(200, ErrorMessage = "Source Client User Id must be no more than 200 characters in length")]
        public string SourceClientUserId { get; set; }

        //[DatabaseGenerated(System.ComponentModel.DataAnnotations.DatabaseGeneratedOption.Computed)]
        public DateTime CreatedDate { get; set; }


    }
}